package com.iceberg.adgt.domain;

import com.iceberg.adgt.common.DomainException;

final class Unit {

	private UnitType type;
	private final String name;

	Unit(String name, UnitType type) throws DomainException {
		if (name.equals("")) {
			throw new DomainException("Name cannot be empty.");
		}

		this.name = name;
		this.type = type;
	}

	UnitType getType() {
		return type;
	}

	String getName() {
		return name;
	}

	@Override
	public String toString() {
		return name;
	}
}
